from django.db import models

# Create your models here.

from django.db import models

# 继承models.Model的类映射到数据库中的一个表

class List(models.Model):
    pass


class Item(models.Model):
    # 定义文本字段,有默认值
    # id = models.AutoField(auto_created=True, primary_key=True)
    text = models.TextField(default='')
    list = models.ForeignKey(List, default=None, on_delete=models.CASCADE)
